gtkwindow: Fix the comment for an optimization
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 15 Jul 2014 18:41:04 +0000 (14:41 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 15 Jul 2014 18:49:16 +0000 (14:49 -0400)
The optimization was incorrect, and so it was changed in commit
2bf6824, but the comment to go along with it was never updated.

gtk/gtkwindow.c

index f764bb88bb1314e908331a0105953e5ce16503d6..76608d355cf00a22b12f60c14cdfcb965c73f09c 100644 (file)
@@ -7155,13 +7155,14 @@ gtk_window_configure_event (GtkWidget         *widget,
       priv->configure_request_count -= 1;
       gdk_window_thaw_toplevel_updates_libgtk_only (gtk_widget_get_window (widget));
     }
-  
-  /* As an optimization, we avoid a resize when possible.
+
+  /* If this is a gratuitous ConfigureNotify that's already
+   * the same as our allocation, then we can fizzle it out.
+   * This is the case for dragging windows around.
    *
-   * The only times we can avoid a resize are:
-   *   - we know only the position changed, not the size
-   *   - we know we have made more requests and so will get more
-   *     notifies and can wait to resize when we get them
+   * We can't do this for a ConfigureRequest, since it might
+   * have been a queued resize from child widgets, and so we
+   * need to reallocate our children in case *they* changed.
    */
   gtk_widget_get_allocation (widget, &allocation);
   if (!expected_reply &&